# -*- coding: utf-8 -*-

"""
@author: jj
@Remark: 设备日志管理
"""
from app.device.models import DeviceStateLog
from dvadmin.utils.serializers import CustomModelSerializer
from dvadmin.utils.viewset import CustomModelViewSet


class DevicestatelogSerializer(CustomModelSerializer):
    """
    序列化器
    """

    class Meta:
        model = DeviceStateLog
        fields = "__all__"
        read_only_fields = ["id"]

#设备日志接口
class DevicestatelogViewSet(CustomModelViewSet):
    """
    设备日志接口
    list:设备日志查询
    create:设备日志新增
    update:设备日志修改
    retrieve:设备日志单例
    destroy:设备日志删除
    multiple_delete:设备日志多删
    """
    queryset = DeviceStateLog.objects.all()
    serializer_class = DevicestatelogSerializer
    # filter_fields = ['creator_id']

    # permission_classes = []
